export default {
  namespaced: true,
  state: () => ({
    title: 'shop moudle',
    num: 300,
  }),
  mutations: {
    SET_TITLE: (state, value) => state.title = value,
  },
  getters: {
    g1(state, getters) {
      return 'shop g1' + state.title;;
    },
    g2(state, getters) {
      return 'shop g2' + state.title;;
    },
  },
  actions: {
    say(store, value) {
      console.log(value + store.state.title + store.rootState.title);
    }
  },
  modules: {
    localShop: {
      namespaced: true,
      state: () => ({
        title: 'localShop moudle',
        num: 2000,
      }),
      mutations: {
        SET_TITLE: (state, value) => state.title = value,
      },
      getters: {
        g1(state, getters) {
          return 'localShop g1' + state.title;;
        },
        g2(state, getters) {
          return 'localShop g2' + state.title;;
        },
      },
      actions: {
        say(store, value) {
          console.log(value + store.state.title + store.rootState.title + store.rootGetters.g1);
        }
      },
    }
  }
}